<html>
  <head>
    <title>Manage Members</title>
   	<script src="./lib/jquery.js" ></script>
   	<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="./lib/jquery.mobile-1.1.1.min.css" />
	<script src="./lib/jquery-1.7.1.min.js"></script>
	<script language="JavaScript" SRC="config.js"></script>
	<script src="./lib/jquery.mobile-1.1.1.min.js"></script>
    <script type="text/javascript" charset="utf-8">
     var query = window.location.search;
  // Skip the leading ?, which should always be there, 
  // but be careful anyway
  if (query.substring(0, 1) == '?') {
    query = query.substring(1);
  }
  var data = query.split(','); 
  for (i = 0; (i < data.length); i++) {
    data[i] = unescape(data[i]);
    data[i]=data[i].replace('userid=','');
  }
  
 function confirmdeleteClick()
 {
    alert("confirmdeleteClick are called");
    $.post('http://'+serverip+'/socialengine/mobileservice/edituser/deleteuser', {userid:data[0]},
	            function(output){
	               alert(output.result);
	            },"json");
	window.location.href = "showAllUser.html";
 }
    function loadData(){
 	alert("Edit user Data[0]="+data[0]);

  	  $('#mylist').append('<li>'+'<a href="userstats.html?userid='+data[0]+'" rel="external">'+'User Status'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="edituseremail.html?userid='+data[0]+'" rel="external">'+'Edit User Email'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="editusername.html?userid='+data[0]+'" rel="external">'+'Edit User Name'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="editdisplayname.html?userid='+data[0]+'" rel="external">'+'Edit Display Name'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="edituserlevel.html?userid='+data[0]+'" rel="external">'+'Edit User Level'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="edituserpassword.html?userid='+data[0]+'" rel="external">'+'Edit User Password'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="approverifiedenable.html?userid='+data[0]+'"'+'rel="external">'+'Approve Verified Enable'+'</a>' +'</li>').listview('refresh');
  	  $('#mylist').append('<li>'+'<a href="#confirmdelete?userid='+data[0]+'"'+' data-rel="dialog">'+'Delete User'+'</a>' +'</li>').listview('refresh');

	 }//end load data
    </script>
  </head>
<body onload="loadData()">
<div data-role="page">
	<div data-role="header">
	<a href="index.html" data-role="button" data-icon="home" data-iconpos="notext" rel="external">Home</a>
		<h1>Manage Members</h1>
	</div><!-- /header -->
	<div   data-role="content">
	<ul data-role="listview"  id="mylist" data-filter="true">
	</ul>
  </div><!-- /content -->

</div><!-- /page -->
<div data-role="dialog" id="confirmdelete" data-theme="c">
	<div data-role="content"data-theme="c">
		<span class="title">Are you sure?</span>

		<button id="confirmdelete" type="button" data-role="button" data-theme="a" onclick="confirmdeleteClick()" >Yes, I'm Sure!</button>
		<a type="button" data-role="button" data-theme="c" data-rel="back">No Way!</a>
	</div>
	
</div>
 </body>
</html>